package io.renren.modules.echarts.ResVo;


import io.renren.modules.echarts.entity.LineEntity;
import lombok.Data;

import java.util.List;
import java.util.stream.Collectors;

@Data
public class LineVo {
    private int year;
    private int temperature;
    private String month;

    public static LineVo build(LineEntity entity){
        LineVo lineVo = new LineVo();
        lineVo.setMonth(entity.getMonth());
        lineVo.setYear(entity.getYear());
        lineVo.setTemperature(entity.getTemperature());
        return lineVo;
    }

    public static List<LineVo> buid(List<LineEntity> entities){
        return entities.stream().map(LineVo::build).collect(Collectors.toList());
    }
}
